<template>
	<view class="news">
		<view class="content">
			<view class="title">
				<u-section title="热点资讯" sub-title="更多" :show-line="false" font-size="34" color="#333333" @click="toMore">
				</u-section>
			</view>
			<view class="listCon">
				<view v-for="(item,index) in list" :key="item.id">
					<news-item :item="item" v-if="item.type ==0 "></news-item>
					<news-big-item :item="item" v-else></news-big-item>
					<u-line color="#E1E1E1" v-if="index !=2" />
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import NewsItem from "@/components/NewsItem.vue"
	import NewsBigItem from "@/components/NewsBigItem.vue"


	export default {
		components: {
			NewsItem,
			NewsBigItem
		},
		props: {
			list: {
				type: Array,
				default: () => []
			},
		},
		data() {
			return {
				
			};
		},
		async created() {
			
		},

		methods: {
			//查看更多
			toMore() {
				this.navigateTo({
					url: "/pages/main/news/index"
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.news {
		position: relative;
		padding: 20rpx;
		padding-top: 0;

		.content {
			width: 100%;
			padding: 15rpx;
			padding-top: 36rpx;
			padding-bottom: 0rpx;
			background: #fff;
			box-shadow: 0rpx 3rpx 10rpx 0rpx rgba(216, 216, 216, 0.49);
			border-radius: 10rpx;

			.title {
				width: 100%;
				padding-left: 5rpx;
			}

			.listCon {
				width: 100%;
				padding-top: 30rpx;
			}
		}
	}
</style>
